package com.gbits.app.finance.convert;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MultiDebitTaxSubjectConvert extends DebitTaxSubjectConvert {

	@Override
	public String doConvert(Map<String, Object> map) {
		Map<String, Object> data = new HashMap<String, Object>();
		data.putAll(map);
		double value = this.getAllTaxAmount(map);
		if (value > 0) {
			List<Map<String, Object>> subjectList = this.getSubjectList(map);
			data.putAll(subjectList.get(0));
			data.put("tax_amount", value);
			data.put("is_contain_tax", "y");
		} else {
			data.put("tax_amount", 0);
			data.put("is_contain_tax", "n");
		}
		return super.doConvert(data);
	}

}
